Skip to content

Commit

Permalink
Install and usage details
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencroff committed Jan 14, 2024
1 parent 986a7aa commit b9eb425
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,55 @@
CCID Go lang implementation

[Reference](https://github.com/Pencroff/ccid)


## How to install

go get -u github.com/Pencroff/ccid_go

## How to use

```go
package main

import (
"fmt"
c "github.com/Pencroff/ccid_go"
e "github.com/Pencroff/ccid_go/extras"
p "github.com/Pencroff/ccid_go/pkg"
)

func main() {
// Create new random bytes reader
r, err := e.NewHybridRandReaderWithSize(e.SIZE_32k)
if err != nil {
fmt.Println(err)
return
}
// Create new strategy for monotonic mutations
s := p.NewFiftyPercentMonotonicStrategy(r)
// Create new CcId generator
ccidGen, err := c.NewMonotonicCcIdGen(p.ByteSliceSize96, r, s)
if err != nil {
fmt.Println(err)
return
}
// Generate new CcId
ccid, err := ccidGen.Next()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("%#v\n", ccid)
// CcId{size: 12, timestamp: 305250750 (2024-01-14T16:45:50Z), payload: 0x9461896a128ac957}
}
```


## How to increase version

* commit all required changes
* `git tag <version - v0.0.2>`
* `git push origin --tags`
* done - check docs on pkg.go.dev

0 comments on commit b9eb425

Please # to comment.