-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(su): hash chain working correctly
- Loading branch information
1 parent
dedeebd
commit 09c6e59
Showing
4 changed files
with
58 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import Arweave from 'arweave'; | ||
|
||
(async function () { | ||
const pid = Arweave.utils.b64UrlToBuffer('kRIwKM5cLvEDWmgbZ8OSDT1SFdJaWQJgtpCJayDd7_4') | ||
const pid = Arweave.utils.b64UrlToBuffer('2sWgl7kzGl1MlBvENlMri2PIWTuwzZ0sx2PpS18fFK4') | ||
const hash = await Arweave.crypto.hash(pid) | ||
const h = Arweave.utils.bufferTob64Url(hash) | ||
console.log(h) | ||
|
||
const mid = Arweave.utils.b64UrlToBuffer('6V-WTZpUEtzyeFur03Hgfl3GkikG5kVS44nJ366GKQg' + 'NCd1EuUNlH0O2O8eaJgFxrGNja0QhHpOWCwLDzFnFcA') | ||
const mhash = await Arweave.crypto.hash(mid) | ||
const mid = Arweave.utils.b64UrlToBuffer('GgJe1wbcyGgvOv0rOnw2kAikoK-p5WGHdCxH_isbrZg') | ||
const lastHash = Arweave.utils.b64UrlToBuffer('iRTGf7FBuKuJWoTOLZbARe9i7Q1N9b0R0iEljPdCH10') | ||
const all = Buffer.concat([mid, lastHash]) | ||
const byteArray = Array.from(all) | ||
|
||
// Print the array of bytes | ||
console.log(byteArray) | ||
const mhash = await Arweave.crypto.hash(all) | ||
const h2 = Arweave.utils.bufferTob64Url(mhash) | ||
console.log(h2) | ||
})() |