hirosystems / hirosystems/recipes

string-to-buff

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

there is no such thing in clarity string-to-buff

You can use to-consensus-buff?
And then remove the type and length bytes at the beginning

(define-read-only (ascii-to-buff (in (string-ascii 100)))
(default-to 0x (match (to-consensus-buff? in) buff (slice? buff u5 (len buff)) none))
)

https://github.com/Rapha-btc/Smart-Wallet/blob/4228dff5512e9d35b5c739b6f1ad7f65649fb226/contracts/passkey-smart-wallet.clar

![Image](https://github.com/user-attachments/assets/f3120665-051f-4dbc-a518-1990b5d3762b)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.