From 1acfe53098333168ffff1a543ae0ad78ca11cf5d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 4 Jun 2022 21:05:03 +0800 Subject: [PATCH] :bug: Fix typo --- kernel/model/osssync.go | 2 +- kernel/model/sync.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/model/osssync.go b/kernel/model/osssync.go index 010c49b31..572938a60 100644 --- a/kernel/model/osssync.go +++ b/kernel/model/osssync.go @@ -723,7 +723,7 @@ func cloudUpsertRemoveListOSS(localDirPath string, cloudFileList map[string]*Clo ignores := syncIgnoreList.Values() for _, p := range ignores { relPath := p.(string) - relPath = pathSha246(relPath, "/") + relPath = pathSha256Short(relPath, "/") relPath = filepath.Join(localDirPath, relPath) excludes[relPath] = true } diff --git a/kernel/model/sync.go b/kernel/model/sync.go index fc267d2be..ba3f4e4c7 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -792,7 +792,7 @@ func prepareSyncData(passwd string, unchangedList map[string]bool) (encryptedDat p := plainP if !strings.HasPrefix(plainP, ".siyuan") { // 配置目录下都用明文,其他文件需要映射文件名 - p = pathSha246(p, string(os.PathSeparator)) + p = pathSha256Short(p, string(os.PathSeparator)) } metaJSON[filepath.ToSlash(p)] = filepath.ToSlash(plainP) @@ -935,7 +935,7 @@ func unchangedSyncList() (ret map[string]bool, removes []string, err error) { ignores := syncIgnoreList.Values() for _, p := range ignores { relPath := p.(string) - relPath = pathSha246(relPath, "/") + relPath = pathSha256Short(relPath, "/") relPath = filepath.Join(syncDir, relPath) excludes[relPath] = true } @@ -956,7 +956,7 @@ func unchangedSyncList() (ret map[string]bool, removes []string, err error) { plainP := strings.TrimPrefix(path, util.DataDir+sep) dataP := plainP - dataP = pathSha246(dataP, sep) + dataP = pathSha256Short(dataP, sep) syncP := filepath.Join(syncDir, dataP) if excludes[syncP] { @@ -1291,7 +1291,7 @@ func getSyncIgnoreList() (ret *hashset.Set) { return } -func pathSha246(p, sep string) string { +func pathSha256Short(p, sep string) string { buf := bytes.Buffer{} parts := strings.Split(p, sep) for i, part := range parts {