UNPKG
@flarenetwork/flarejs
Version:
beta (4.1.1-rc0)
latest (4.1.1)
4.1.1
4.1.1-rc0
4.1.0-rc0
4.0.5
4.0.5-prerelease.0
1.3.2
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
Flare Platform JS Library
github.com/flare-foundation/flare-js
flare-foundation/flare-js
@flarenetwork/flarejs
/
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
)); }