fn unseal
open under a name that use std.topic { … } can import (open is a keyword in import lists).
Example:
use std.topic { seal, unseal }
use std.core { Utf8 }
fn main() -> () | TopicError io, db {
let sealed = seal("Payments", "card", Utf8.encode("secret"))?
print("{Utf8.decode(unseal("Payments", "card", sealed)?)!}")
}Вывод
secret
pub(api) fn unseal(name: str, field: str, sealed: bytes) -> bytes | TopicError dbС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
name | str |
field | str |
sealed | bytes |
Возвращает
bytes
Ошибки
TopicError@error- `TopicError` when the ciphertext was changed or belongs to another topic or field.
Эффекты
db
Определено в: std/topic/topic.oxl:764