0.0.1 • Published 3 years ago
globalid-web-crypto v0.0.1
Getting Started with GlobalID web crypto library
Available Scripts
In the project directory, you can run:
yarn clear
Clears the lib
folder.\
yarn build
Builds the library for production to the lib
folder.\
It correctly bundles dependencies in production mode and optimizes the build for the best performance.
yarn watch
Builds library in development mode and watches for changes made.
yarn lint
Runs eslint.
yarn lint:fix
Runs eslint and fixes potentially fixable issues.
yarn test
Launches the unit tests.
yarn test:watch
Launches the unit tests in watch mode.
Changes from old GlobalID Crypto Lib Web
RSA
encrypt
function changed order of arguments new order(data: string, publicKey: ArrayBuffer | string)
decrypt
function changed order of arguments new order(encryptedData: string, privateKey: ArrayBuffer | string)
sign
function changed order of arguments new order(data: string, privateKey: string)
verifySignature
function changed order of arguments new order(data: string, publicKey: string, signature: string)
UTIL
stringToBytes
now returnsnumbers[]
before it returnedUint8Array
hmacSHA512
was removed due to circular dependency useHMAC.sha512
instead.
Writing tests
For unit testing we use Jest and for e2e test we use Jasmine, because of this there are conflicts with type definitions. To resolve this issues add:
/// <reference path="../node_modules/@types/jest/index.d.ts" />
at the start of unit tests/// <reference path="../../node_modules/@types/jasmine/index.d.ts" />
at the start of e2e tests
0.0.1
3 years ago