GitXplorerGitXplorer
a

ksuid-cli

public
6 stars
1 forks
0 issues

Commits

List of commits on branch master.
Verified
cfb0f1040e9e716926f0b96ae7a7a3dcb4f4f58c

Merge pull request #2 from rynop/patch-1

aandyburke committed 2 years ago
Verified
27253a494be7d9428e4c0a49cea087e564d2dd4c

update inspect example

rrynop committed 2 years ago
Unverified
c48765294e6b6f9b4746a2de642bf8f53258ddf0

bin definition to improve npm install -g behavior

aandyburke committed 6 years ago
Unverified
4ac3ef19789ad4da40833e68135fff00395d4a50

update README

aandyburke committed 6 years ago
Unverified
df488c0b67aa55d6443fbb059e5f000fd976880d

update README

aandyburke committed 6 years ago
Unverified
be73eafc1a9c8d3d66fe3a3655381b695bb78844

Initial commit

aandyburke committed 6 years ago

README

The README file for this repository.

ksuid-cli

A Command Line Interface for dealing with Segment's KSUIDs.

Uses Mark Wubben's KSUID node.js library.

Installation

$ npm install ksuid-cli

This package comes with a simple command-line tool ksuid. This tool can generate KSUIDs as well as inspect the internal components for debugging purposes.

Usage examples

Generate 4 KSUIDs

> ksuid -n 4
151zKb0yBE31siVu9GYmpi1vlfe
151zKUmtgUA8kRSgg5Q6tG6vqPx
151zKTalsFp5ddmaiEaXu7l3YTD
151zKUVLrYKQ1p6XNDRPIFbrN1w

Inspect the components of a KSUID

Using the inspect formatting on just 1 ksuid:

> ksuid -f inspect 151zOCJ2I9szGtX4VwDJjnmvrpZ

REPRESENTATION:

  String: 151zOCJ2I9szGtX4VwDJjnmvrpZ
     Raw: 0793CB58A38B910C80235B72A6F6B5DF5CA3C929

COMPONENTS:

       Time: 2018-05-24T01:46:00.000Z
  Timestamp: 127126360
    Payload: A38B910C80235B72A6F6B5DF5CA3C929

Using the template formatting on 4 ksuid:

> ksuid -f template -t '{{ .Time }}: {{ .Payload }}' -n 4
2018-05-24T01:46:31.000Z: B34547537772BBC0E2F29CACFC0BB5C2
2018-05-24T01:46:31.000Z: 79A4B61465263502F6F6B3D686F3B48E
2018-05-24T01:46:31.000Z: DBBF7F076962352AD8D60D45A34F5499
2018-05-24T01:46:31.000Z: B00E173900EBB05D768CADF13C3583D0

Generate detailed versions of new KSUID

Generate a new KSUID with the corresponding time using the time formatting:

> ksuid -f time -v
151zVo4Jr8dajx0fqHWAPxDbHRs: 2018-05-24T01:47:01.000Z

Generate 4 new KSUID with details using template formatting:

> ksuid -f template -t '{ "timestamp": "{{ .Timestamp }}", "payload": "{{ .Payload }}", "ksuid": "{{.String}}"}' -n 4
{ "timestamp": "127126441", "payload": "AF7BF3D0DB709B7933AF1AE83FBF4FBA", "ksuid": "151zYNlpxMf7nbb8CikaE4SUPQw"}
{ "timestamp": "127126441", "payload": "6E92616BDA6CC1B983D238E496080BAC", "ksuid": "151zYLnLhlehuIEeodZLMQ41c4a"}
{ "timestamp": "127126441", "payload": "8D55A9221F760433347F2B08C597AF3F", "ksuid": "151zYMjOiZv7K8q4dEYYySDpyu7"}
{ "timestamp": "127126441", "payload": "22FB4CB82107AC16628F77F60A5BFFE0", "ksuid": "151zYJUiEi4iniicXeu9xShcm3c"}

Display the detailed version of a new KSUID:

> ksuid -f inspect

REPRESENTATION:

  String: 151zbEzzY29y1EMfAycgv4kZTod
     Raw: 0793CBC06EA61F24424C8C6ED6DD3C7540AB013F

COMPONENTS:

       Time: 2018-05-24T01:47:44.000Z
  Timestamp: 127126464
    Payload: 6EA61F24424C8C6ED6DD3C7540AB013F