Documentation ¶
Overview ¶
Package parse builds parse trees for crypt(3) hashes.
Supported schemes:
- DES: <value>(<value>)*
- DES Extended (BSDi): _<value>(<value>)*
- MCF/PHC: $<id>$fragment($<fragment>)* Where:
- <fragment> is (<group>|<param>=<value>|<value>)
- <group> is <param>=<value>,<param>=<value>(,<param>=<value>)*
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FragmentNode ¶
type FragmentNode interface { Node // contains filtered or unexported methods }
FragmentNode represents a fragment separated by '$'.
type GroupNode ¶
type GroupNode struct {
Values []*ValueNode // len(Values) > 0
}
GroupNode represents a comma-separated list of values.
type Node ¶
type Node interface { Type() NodeType String() string Pos() Pos // position of first byte belonging to the node End() Pos // position of first byte immediately after the node // contains filtered or unexported methods }
Node is an element in the parse tree. The interface contains an unexported method so that only types local to this package can satisfy it.
type PrefixNode ¶
type PrefixNode struct { Text string // contains filtered or unexported fields }
PrefixNode holds a hash prefix, like '_', '$id$' or '$id,'.
func (*PrefixNode) End ¶
func (p *PrefixNode) End() Pos
func (*PrefixNode) Pos ¶
func (p *PrefixNode) Pos() Pos
func (*PrefixNode) String ¶
func (p *PrefixNode) String() string
func (*PrefixNode) Type ¶
func (p *PrefixNode) Type() NodeType
type SyntaxError ¶
type SyntaxError struct { Offset int // byte offset in input where error was detected Msg string // description of error }
SyntaxError suggests that the hash is invalid.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type Tree ¶
type Tree struct { Prefix *PrefixNode Fragments []FragmentNode }
Tree is the representation of a single parsed hash.
Click to show internal directories.
Click to hide internal directories.