base32: Export the base32 charsets.

* guix/base32.scm (%nix-base32-charset, %rfc4648-base32-charset): New
variables.
master
Ludovic Courtès 2017-07-21 14:32:24 +02:00
parent 75a4d86f50
commit 0a94dc6396
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -28,6 +28,8 @@
bytevector->nix-base32-string
base32-string->bytevector
nix-base32-string->bytevector
%nix-base32-charset
%rfc4648-base32-charset
&invalid-base32-character
invalid-base32-character?
invalid-base32-character-value
@ -152,11 +154,17 @@ the previous application or INIT."
#\a #\b #\c #\d #\f #\g #\h #\i #\j #\k #\l #\m #\n
#\p #\q #\r #\s #\v #\w #\x #\y #\z))
(define %nix-base32-charset
(list->char-set (vector->list %nix-base32-chars)))
(define %rfc4648-base32-chars
#(#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m
#\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z
#\2 #\3 #\4 #\5 #\6 #\7))
(define %rfc4648-base32-charset
(list->char-set (vector->list %rfc4648-base32-chars)))
(define bytevector->base32-string
(make-bytevector->base32-string bytevector-quintet-fold
%rfc4648-base32-chars))