Skip to content

Commit

Permalink
Merge pull request #6455 from blockchain/fix/v4-wrapper
Browse files Browse the repository at this point in the history
fix(checksum): add checksum
  • Loading branch information
CTucker-BC authored Sep 12, 2024
2 parents 775a6c4 + 62a917f commit 8b5cc03
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/blockchain-wallet-v4/src/types/Wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import * as Options from './Options'
import Type from './Type'

This comment has been minimized.

Copy link
@09021979

09021979 Oct 2, 2024

Me Manuel Ziemer

import * as Wallet from './Wallet'

let _window = {}
if (typeof window === 'undefined' || !window) _window = {}
else _window = window

// Global Crypto object
const { Crypto } = _window

const PAYLOAD_VERSION = crypto.SUPPORTED_ENCRYPTION_VERSION

/* Wrapper :: {
Expand Down Expand Up @@ -142,6 +149,7 @@ export const fromEncPayload = curry((password, payload) => {
const wrapper = {
password,
payload: JSON.stringify(payload),
payload_checksum: Crypto ? Crypto.SHA256(JSON.stringify(payload), { asHex: true }) : undefined,
pbkdf2Iterations,
version
}
Expand Down

0 comments on commit 8b5cc03

Please sign in to comment.