# porcelain

cli dollcode encoder and decoder

## example usage

### encode

```sh
porcelain encode 893271
# ▖▖▘▘▌▘▌▌▘▘▘▌▌
porcelain encode 0xda157
# ▖▖▘▘▌▘▌▌▘▘▘▌▌
porcelain encode -x da157 # or --hex
# ▖▖▘▘▌▘▌▌▘▘▘▌▌
```

### decode

```sh
porcelain decode ▖▖▘▘▌▘▌▌▘▘▘▌▌
# decimial: 893271, hexadecimal: DA157
porcelain decode -d ▖▖▘▘▌▘▌▌▘▘▘▌ # or --decimial
# 893271
porcelain decode --hex ▖▖▘▘▌▘▌▌▘▘▘▌▌ # or -x
# DA157
```

## packaged

### crates.io

```sh
cargo install porcelain
```

### nix flake

run without installing

```sh
nix run https://codeberg.org/da157/porcelain/archive/main.tar.gz -- encode 0xda157
```

install onto nixos system (with flakes)

```nix
# flake.nix
{
  inputs = {
    # ...
    porcelain = {
      url = "https://codeberg.org/da157/porcelain/archive/main.tar.gz";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, ... }@inputs: {
    nixosConfigurations.default = nixpkgs.lib.nixosSystem {
      modules = [ ./configuration.nix ];
      specialArgs = { inherit inputs; };
    };
  }
}
# configuration.nix
{ pkgs, inputs, ... }:
{
  environment.systemPackages = [
    inputs.porcelain.packages.${pkgs.stdenv.hostPlatform.system}.porcelain
  ];
}
```
