调整
This commit is contained in:
parent
9eb5d2bd96
commit
3bf4b7baa4
@ -4,3 +4,7 @@
|
||||
export function CalcMD5(arg1:string,arg2:number):Promise<string>;
|
||||
|
||||
export function CalcSHA1(arg1:string,arg2:number):Promise<string>;
|
||||
|
||||
export function CalcSHA256(arg1:string,arg2:number):Promise<string>;
|
||||
|
||||
export function CalcSHA512(arg1:string,arg2:number):Promise<string>;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user