Skip to content

nationalarchives/oci-tools-ts

Repository files navigation

Omega Catalog Identifier tools (TypeScript)

Build Status TypeScript 3.8 License

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:

  1. a library (base-coder.ts) which can be used in other projects.

  2. a command line tool (main.ts) which is useful in itself and also serves as an example of using the base-coder.ts library.

Examples of Command Line tool use

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'

Compiling the Command Line tool

To build from source you will need the following pre-requisites:

  1. NPM 6.14+.
  2. NodeJs 10.16+

If you wish to compile the application you can run npm run build.

Releases

No releases published

Packages

No packages published