Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Apr 14, 2024
1 parent 6897865 commit 9a3501c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The default context in Noir already imports the following modules from the Pytho
- datetime
- hashlib
- random
- uuid

> **Note:** additional modules from standard library might be loaded with the `import` statement
Expand All @@ -79,6 +80,32 @@ foo="{{ =env.VAR_FOO }}"
bar="{{ =env["VAR_BAR"] }}"
```

#### Base64 shortcuts

Shortcuts for `base64.b64encode` and `base64.b64decode` handling encoding/decoding:

```yaml
hash: {{ =base64encode("foobar") }}
decoded_hash: {{ =base64decode(hash) }}
```
#### CIDR helpers
Functions to interact with IPv4/IPv6 objects:
```
cidr.subnet(prefix, newbits, netnum)
cidr.host(prefix, hostnum)
cidr.netmask(prefix)
cidr.subnets(prefix, *newbits)
```

#### Pathlib Path

```yaml
target: {{ =Path.cwd() / "target" / "foo.bar" }}
```
#### indent
A function to indent a text with the given number of spaces.
Expand Down

0 comments on commit 9a3501c

Please sign in to comment.