0.0.1 • Published 5 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
encryptfunction changed order of arguments new order(data: string, publicKey: ArrayBuffer | string)decryptfunction changed order of arguments new order(encryptedData: string, privateKey: ArrayBuffer | string)signfunction changed order of arguments new order(data: string, privateKey: string)verifySignaturefunction changed order of arguments new order(data: string, publicKey: string, signature: string)
UTIL
stringToBytesnow returnsnumbers[]before it returnedUint8ArrayhmacSHA512was removed due to circular dependency useHMAC.sha512instead.
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
5 years ago