UNPKG
@bitgo-forks/avalanchejs
Version:
latest (4.1.0-alpha.1)
master (4.1.0-alpha.3)
4.1.0-alpha.3
4.1.0-alpha.2
4.1.0-alpha.1
Avalanche Platform JS Library
github.com/BitGo/avalanchejs
BitGo/avalanchejs
@bitgo-forks/avalanchejs
/
src
/
utils
/
addChecksum.ts
7 lines
(5 loc)
•
193 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{ sha256 }
from
'@noble/hashes/sha256'
;
import
{ concatBytes }
from
'./buffer'
;
export
function
addChecksum
(
data:
Uint8Array
) {
return
concatBytes
(data,
sha256
(data).
subarray
(-
4
)); }