Skip to content

Instantly share code, notes, and snippets.

@standardci
Last active October 12, 2022 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save standardci/82fa534204125094b988115a485bad37 to your computer and use it in GitHub Desktop.
Save standardci/82fa534204125094b988115a485bad37 to your computer and use it in GitHub Desktop.
Computing your legacy private workspace identifier
const crypto = require('crypto')
const userphrase = 'REPLACE_ME'
const name = 'REPLACE_ME'
const userphraseHash = crypto.createHash('sha256').update(name).digest('hex');
const nameHash = crypto.createHash('sha256').update(userphrase).digest('hex');
crypto.createHmac('sha256', Buffer.from(userphraseHash, 'hex')).update(nameHash).digest("hex");E

To run the script locally on a desktop computer:

  1. Open a terminal window and type node, then press enter.
  2. Copy and paste the text in the index.js file below, replacing instances of REPLACE_ME with your respective values for userphrase and name.

You can also use an online NodeJS playground, such as Runkit.com. You can fork our script here: https://runkit.com/standardnotes/computing-your-legacy-private-workspace-identifier

Note that an account on Runkit seems to be required before making changes to a script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment