-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Base encoding methods | ||
|
||
With the methods of the `Base` module, you can pass which case you want the | ||
output string to be encoded in. Default is upper, but lower can be achieved | ||
without `String.downcase/1`: | ||
|
||
```elixir | ||
iex(1)> bytes = :crypto.strong_rand_bytes(32) | ||
<<10, 172, 2, 91, 154, 240, 89, 162, 143, 96, 28, 69, 174, | ||
179, 223, 221, 232, 248, 28, 193, 159, 57, 142, 148, 188, | ||
215, 14, 42, 69, 35, 225, 48>> | ||
iex(2)> bytes |> Base.encode16() | ||
"0AAC025B9AF059A28F601C45AEB3DFDDE8F81CC19F398E94BCD70E2A4523E130" | ||
iex(3)> bytes |> Base.encode16(case: :lower) | ||
"0aac025b9af059a28f601c45aeb3dfdde8f81cc19f398e94bcd70e2a4523e130" | ||
|
||
``` | ||
|
||
[source](https://hexdocs.pm/elixir/Base.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,61 @@ | ||
{"C++":["Scoped enums"],"JavaScript":["File system flags in Node","Readline interface","Readline interface 2","Regular expression flags"],"shell":["List directories only","`mv` Tips and Tricks","Oh My Zsh Aliases","String manipulation","`which`"],"vim":["Ruler"],"WebAssembly":["Break statements","Global variables","Memory management","Tables"],"Rails":["Active record attributes","`select` vs `pluck`"],"PostgreSQL":["Filter clause"],"VS Code":["External terminal"],"Ruby":["`squeeze`"],"Linux":["Force quit hung ssh","Killing other ssh connections","U2F","Yubico Authenticator on Fedora"],"git":["Find file creation date","Push commit with tags","Set commit message editor"],"nginx":["Redirect requests to new domain"],"Elixir":["Get last value in IEx","Test coverage","Test setup","Turn on history in IEx"]} | ||
{ | ||
"C++": [ | ||
"Scoped enums" | ||
], | ||
"JavaScript": [ | ||
"File system flags in Node", | ||
"Readline interface", | ||
"Readline interface 2", | ||
"Regular expression flags" | ||
], | ||
"shell": [ | ||
"List directories only", | ||
"`mv` Tips and Tricks", | ||
"Oh My Zsh Aliases", | ||
"String manipulation", | ||
"`which`" | ||
], | ||
"vim": [ | ||
"Ruler" | ||
], | ||
"WebAssembly": [ | ||
"Break statements", | ||
"Global variables", | ||
"Memory management", | ||
"Tables" | ||
], | ||
"Rails": [ | ||
"Active record attributes", | ||
"`select` vs `pluck`" | ||
], | ||
"PostgreSQL": [ | ||
"Filter clause" | ||
], | ||
"VS Code": [ | ||
"External terminal" | ||
], | ||
"Ruby": [ | ||
"`squeeze`" | ||
], | ||
"Linux": [ | ||
"Force quit hung ssh", | ||
"Killing other ssh connections", | ||
"U2F", | ||
"Yubico Authenticator on Fedora" | ||
], | ||
"git": [ | ||
"Find file creation date", | ||
"Push commit with tags", | ||
"Set commit message editor" | ||
], | ||
"nginx": [ | ||
"Redirect requests to new domain" | ||
], | ||
"Elixir": [ | ||
"Base encoding methods", | ||
"Get last value in IEx", | ||
"Test coverage", | ||
"Test setup", | ||
"Turn on history in IEx" | ||
] | ||
} |