Documentation ¶
Overview ¶
Package stringprep implements Stringprep as described in RFC 3454, including the Nameprep profile.
This package is in beta and is still being written and tested.
Index ¶
Constants ¶
const ( Unassigned valueType = iota Map Prohibited Delete )
const ( NFKC = 1 BIDI = 2 MAP_TABLE = 3 UNASSIGNED_TABLE = 4 PROHIBIT_TABLE = 5 BIDI_PROHIBIT_TABLE = 6 BIDI_RAL_TABLE = 7 BIDI_L_TABLE = 8 )
Steps in a stringprep profile.
const MaxMapChars = 4
MaxMapChars is the largest number of runes/bytes a mapping will take up.
Variables ¶
var ( // Profiles is a map of the various stringprep profiles we implement. Profiles = map[string]Profile{ "nameprep": nameprepProfile, } )
var Tables = map[string]Table{
"A1": _A1,
"B1": _B1,
"B2": _B2,
"B3": _B3,
"C11": _C11,
"C12": _C12,
"C21": _C21,
"C22": _C22,
"C3": _C3,
"C4": _C4,
"C5": _C5,
"C6": _C6,
"C7": _C7,
"C8": _C8,
"C9": _C9,
"D1": _D1,
"D2": _D2,
}
Tables defines the various unicode tables.
Functions ¶
Types ¶
type Iter ¶
type Iter struct{}
An Iter iterates over a string or byte slice, while preparing it with a given Profile.
func (*Iter) Next ¶
Next writes p(i.input[i.Pos():n]...) to buffer buf, where n is the largest boundary of i.input such that the result fits in buf. It returns the number of bytes written to buf. len(buf) should be at least MaxSegmentSize. Done must be false before calling Next.
func (*Iter) Pos ¶
Pos returns the byte position at which the next call to Next will commence processing.
func (*Iter) SetInput ¶
SetInput initializes i to iterate over src after normalizing it to Profile p.
func (*Iter) SetInputString ¶
SetInputString initializes i to iterate over src after normalizing it to Profile p.
type Profile ¶
type Profile []ProfileElement
type ProfileElement ¶
type Table ¶
type Table []TableElement