- 
                Notifications
    You must be signed in to change notification settings 
- Fork 162
rm js-sha256 #2539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
rm js-sha256 #2539
Changes from all commits
3d59dff
              c57792c
              4deccae
              7c866d1
              fe61d40
              77257ac
              e1fdce9
              159e1f5
              f525377
              6faeda7
              cddab99
              bcf2a42
              f25d24f
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: pkg.pr preview release | ||
|  | ||
| on: | ||
| pull_request: | ||
| # Run the workflow when labels are added to a PR or when the PR is updated. | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - labeled | ||
| - reopened | ||
|  | ||
| permissions: | ||
| # Allow the workflow to add comments to pull requests when publishing. | ||
| pull-requests: write | ||
|  | ||
| jobs: | ||
| Pkg-pr-new: | ||
| # Only run this job when the pull request contains the pkg‑pr‑release label. | ||
| if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'pkg-pr-release') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Node.JS 20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| - name: build | ||
| uses: ./.github/actions/build | ||
| - name: Build o1js and mina-signer | ||
| run: | | ||
| npm run prepublish:full | ||
| cd src/mina-signer | ||
| npm ci | ||
| npm run prepublish:full | ||
| - name: Publish o1js and mina-signer on pkg-pr-new | ||
| run: npx pkg-pr-new publish ./ ./src/mina-signer # Enable `--compact` once published to NPM with `repository` in package.json | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1 +1 @@ | ||
| sha256-ww0EdkEWiciR6XLTu2/lfqtDMbvIDBLj+gyPH+lpLTE= | ||
| sha256-xGz183aZzn46B0pSwmy9oOCNujTLDQwlDBMbVLfAodA= | 
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { versionBytes } from '../../bindings/crypto/constants.js'; | ||
| import { Binable, withVersionNumber } from '../../bindings/lib/binable.js'; | ||
| import { sha256 } from 'js-sha256'; | ||
| import { sha256 } from '@noble/hashes/sha256'; | ||
| import { changeBase } from '../../bindings/crypto/bigint-helpers.js'; | ||
|  | ||
| export { toBase58Check, fromBase58Check, base58, withBase58, fieldEncodings, Base58, alphabet }; | ||
|  | @@ -62,11 +62,12 @@ function fromBase58(base58: string) { | |
| } | ||
|  | ||
| function computeChecksum(input: number[] | Uint8Array) { | ||
| let inputBytes = input instanceof Uint8Array ? input : new Uint8Array(input); | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:  | ||
| let hash1 = sha256.create(); | ||
| hash1.update(input); | ||
| hash1.update(inputBytes); | ||
| let hash2 = sha256.create(); | ||
| hash2.update(hash1.array()); | ||
| return hash2.array().slice(0, 4); | ||
| hash2.update(hash1.digest()); | ||
| return Array.from(hash2.digest().slice(0, 4)); | ||
| } | ||
|  | ||
| type Base58<T> = { | ||
|  | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.