mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-13 10:45:51 +00:00
Sha256Hash: Remove deprecated methods.
This commit is contained in:
parent
53bd04e426
commit
029d096d8a
@ -41,24 +41,11 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
|
|||||||
|
|
||||||
private final byte[] bytes;
|
private final byte[] bytes;
|
||||||
|
|
||||||
/**
|
private Sha256Hash(byte[] rawHashBytes) {
|
||||||
* Use {@link #wrap(byte[])} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public Sha256Hash(byte[] rawHashBytes) {
|
|
||||||
checkArgument(rawHashBytes.length == LENGTH);
|
checkArgument(rawHashBytes.length == LENGTH);
|
||||||
this.bytes = rawHashBytes;
|
this.bytes = rawHashBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Use {@link #wrap(String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public Sha256Hash(String hexString) {
|
|
||||||
checkArgument(hexString.length() == LENGTH * 2);
|
|
||||||
this.bytes = Utils.HEX.decode(hexString);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance that wraps the given hash value.
|
* Creates a new instance that wraps the given hash value.
|
||||||
*
|
*
|
||||||
@ -66,7 +53,6 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
|
|||||||
* @return a new instance
|
* @return a new instance
|
||||||
* @throws IllegalArgumentException if the given array length is not exactly 32
|
* @throws IllegalArgumentException if the given array length is not exactly 32
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation") // the constructor will be made private in the future
|
|
||||||
public static Sha256Hash wrap(byte[] rawHashBytes) {
|
public static Sha256Hash wrap(byte[] rawHashBytes) {
|
||||||
return new Sha256Hash(rawHashBytes);
|
return new Sha256Hash(rawHashBytes);
|
||||||
}
|
}
|
||||||
@ -90,17 +76,10 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
|
|||||||
* @return a new instance
|
* @return a new instance
|
||||||
* @throws IllegalArgumentException if the given array length is not exactly 32
|
* @throws IllegalArgumentException if the given array length is not exactly 32
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation") // the constructor will be made private in the future
|
|
||||||
public static Sha256Hash wrapReversed(byte[] rawHashBytes) {
|
public static Sha256Hash wrapReversed(byte[] rawHashBytes) {
|
||||||
return wrap(Utils.reverseBytes(rawHashBytes));
|
return wrap(Utils.reverseBytes(rawHashBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Use {@link #of(byte[])} instead: this old name is ambiguous. */
|
|
||||||
@Deprecated
|
|
||||||
public static Sha256Hash create(byte[] contents) {
|
|
||||||
return of(contents);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance containing the calculated (one-time) hash of the given bytes.
|
* Creates a new instance containing the calculated (one-time) hash of the given bytes.
|
||||||
*
|
*
|
||||||
@ -111,12 +90,6 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
|
|||||||
return wrap(hash(contents));
|
return wrap(hash(contents));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Use {@link #twiceOf(byte[])} instead: this old name is ambiguous. */
|
|
||||||
@Deprecated
|
|
||||||
public static Sha256Hash createDouble(byte[] contents) {
|
|
||||||
return twiceOf(contents);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance containing the hash of the calculated hash of the given bytes.
|
* Creates a new instance containing the hash of the calculated hash of the given bytes.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user