com.google.bitcoin.core
Class VersionedChecksummedBytes
java.lang.Object
com.google.bitcoin.core.VersionedChecksummedBytes
- Direct Known Subclasses:
- Address, DumpedPrivateKey
public class VersionedChecksummedBytes
- extends Object
In Bitcoin the following format is often used to represent some type of key:
[one version byte] [data bytes] [4 checksum bytes]
and the result is then Base58 encoded. This format is used for addresses, and private keys exported using the
dumpprivkey command.
version
protected int version
bytes
protected byte[] bytes
VersionedChecksummedBytes
protected VersionedChecksummedBytes(String encoded)
throws AddressFormatException
- Throws:
AddressFormatException
VersionedChecksummedBytes
protected VersionedChecksummedBytes(int version,
byte[] bytes)
toString
public String toString()
- Overrides:
toString
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
getVersion
public int getVersion()
- Returns the "version" or "header" byte: the first byte of the data. This is used to disambiguate what the
contents apply to, for example, which network the key or address is valid on.
- Returns:
- A positive number between 0 and 255.
Copyright © 2011. All Rights Reserved.