Note: There is also an alternative implementation in Scala available at: https://github.com/nationalarchives/oci-tools-scala
This project is split into two parts:
-
a library (
base-coder.ts
) which can be used in other projects. -
a command line tool (
main.ts
) which is useful in itself and also serves as an example of using thebase-coder.ts
library.
Encoding to Base16 (e.g. hexadecimal):
❯ npm run start encode --round-trip 16 123456 HEX
Input: 123456
Encoded: '1E240'
Round-trip decoded: '123456'
Encoding to GCR b25 (e.g. as used by DRI for digital records):
❯ npm run start encode --round-trip 25 123456 GCRb25
Input: 123456
Encoded: 'K5RJ'
Round-trip decoded: '123456'
Encoding to OCI b25 (e.g. as used by Project Omega):
❯ npm run start encode --round-trip 25 123456 OCIb25
Input: 123456
Encoded: '8WJ7'
Round-trip decoded: '123456'
To build from source you will need the following pre-requisites:
- NPM 6.14+.
- NodeJs 10.16+
If you wish to compile the application you can run npm run build
.