diff --git a/app/wails/frontend/wailsjs/go/hash/Support.d.ts b/app/wails/frontend/wailsjs/go/hash/Support.d.ts index 4f46d2d..a876cd7 100644 --- a/app/wails/frontend/wailsjs/go/hash/Support.d.ts +++ b/app/wails/frontend/wailsjs/go/hash/Support.d.ts @@ -4,3 +4,7 @@ export function CalcMD5(arg1:string,arg2:number):Promise; export function CalcSHA1(arg1:string,arg2:number):Promise; + +export function CalcSHA256(arg1:string,arg2:number):Promise; + +export function CalcSHA512(arg1:string,arg2:number):Promise; diff --git a/app/wails/frontend/wailsjs/go/hash/Support.js b/app/wails/frontend/wailsjs/go/hash/Support.js index e776d7e..c6e7fb8 100644 --- a/app/wails/frontend/wailsjs/go/hash/Support.js +++ b/app/wails/frontend/wailsjs/go/hash/Support.js @@ -9,3 +9,11 @@ export function CalcMD5(arg1, arg2) { export function CalcSHA1(arg1, arg2) { return window['go']['hash']['Support']['CalcSHA1'](arg1, arg2); } + +export function CalcSHA256(arg1, arg2) { + return window['go']['hash']['Support']['CalcSHA256'](arg1, arg2); +} + +export function CalcSHA512(arg1, arg2) { + return window['go']['hash']['Support']['CalcSHA512'](arg1, arg2); +} diff --git a/app/wails/pkg/sdk/file/hash/hash.go b/app/wails/pkg/sdk/file/hash/hash.go index 2f969bf..8881a17 100644 --- a/app/wails/pkg/sdk/file/hash/hash.go +++ b/app/wails/pkg/sdk/file/hash/hash.go @@ -17,7 +17,7 @@ func New(fileSupport *fileSdk.Support) *Support { return &Support{fileSupport} } -func (s *Support) CalcSha512(path string, readSize int64) (hash string, err error) { +func (s *Support) CalcSHA512(path string, readSize int64) (hash string, err error) { h := sha512.New() _, err = s.fileSupport.CopyN(h, path, readSize) if err != nil { @@ -27,7 +27,7 @@ func (s *Support) CalcSha512(path string, readSize int64) (hash string, err erro return hex.EncodeToString(h.Sum(nil)), nil } -func (s *Support) CalcSha256(path string, readSize int64) (hash string, err error) { +func (s *Support) CalcSHA256(path string, readSize int64) (hash string, err error) { h := sha256.New() _, err = s.fileSupport.CopyN(h, path, readSize) if err != nil {