lib/money-tree/node.rb
# path: a path of subkeys denoted by numbers and slashes. Use
#     p or i<0 for private key derivation. End with .pub to force
#     the key public.
# 
# Examples:
#     1p/-5/2/1 would call subkey(i=1, is_prime=True).subkey(i=-5).
#         subkey(i=2).subkey(i=1) and then yield the private key
#     0/0/458.pub would call subkey(i=0).subkey(i=0).subkey(i=458) and
#         then yield the public key
# 
# You should choose either the p or the negative number convention for private key derivation.
a path of subkeys denoted by numbers and slashes. Use
p or i<0 for private key derivation. End with .pub to force
the key public.



You should choose either the p or the negative number convention for private key derivation.
a path of subkeys denoted by numbers and slashes . Use p or i<0 for private key derivation . End with . pub to force the key public . You should choose either the p or the negative number convention for private key derivation .
def node_for_path(path)
      force_public = path[-4..-1] == '.pub'
      path = path[0..-5] if force_public
      parts = path.split('/')
      nodes = []
      parts.each_with_index do |part, depth|
        if part =~ /m/i
          nodes << self
        else
          i = parse_index(part)
          node = nodes.last || self
          nodes << node.subnode(i)
        end
      end
      if force_public or parts.first == 'M'
        node = nodes.last
        node.strip_private_info!
        node
      else
        nodes.last
      end
    end
def node_for_path ( path ) force_public = path [ - 4 .. - 1 ] == '.pub' path = path [ 0 .. - 5 ] if force_public parts = path . split ( '/' ) nodes = [ ] parts . each_with_index do | part , depth | if part =~ / m /i nodes << self else i = parse_index ( part ) node = nodes . last || self nodes << node . subnode ( i ) end end if force_public or parts . first == 'M' node = nodes . last node . strip_private_info! node else nodes . last end end
path: a path of subkeys denoted by numbers and slashes.
path : a path of subkeys denoted by numbers and slashes .
path
<not_specific>