This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ export class Sha1 extends Hash<sha1result> {
13
13
protected static heap_pool = [ ] ;
14
14
protected static asm_pool = [ ] ;
15
15
protected static asm_function = sha1_asm ;
16
+
17
+ static bytes ( data : Uint8Array ) : Uint8Array {
18
+ return new Sha1 ( ) . process ( data ) . finish ( ) . result ;
19
+ }
16
20
}
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ export class Sha256 extends Hash<sha256result> {
13
13
protected static heap_pool = [ ] ;
14
14
protected static asm_pool = [ ] ;
15
15
protected static asm_function = sha256_asm ;
16
+
17
+ static bytes ( data : Uint8Array ) : Uint8Array {
18
+ return new Sha256 ( ) . process ( data ) . finish ( ) . result ;
19
+ }
16
20
}
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ export class Sha512 extends Hash<sha512result> {
13
13
protected static heap_pool = [ ] ;
14
14
protected static asm_pool = [ ] ;
15
15
protected static asm_function = sha512_asm ;
16
+
17
+ static bytes ( data : Uint8Array ) : Uint8Array {
18
+ return new Sha512 ( ) . process ( data ) . finish ( ) . result ;
19
+ }
16
20
}
You can’t perform that action at this time.
0 commit comments