com.hedera.hashgraph.sdk.utils.Bip32Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-jdk7 Show documentation
Show all versions of sdk-jdk7 Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
package com.hedera.hashgraph.sdk.utils;
/**
* Utility class for BIP32 functionalities
*/
public class Bip32Utils {
/**
* Indicates if the index is hardened
*/
public static final int HARDENED_BIT = 0x80000000;
private Bip32Utils() {
throw new IllegalStateException("Utility class");
}
/**
* Harden the index
*
* @param index the derivation index
* @return the hardened index
*/
public static int toHardenedIndex(int index) {
return index | HARDENED_BIT;
}
/**
* Check if the index is hardened
*
* @param index the derivation index
* @return true if the index is hardened
*/
public static boolean isHardenedIndex(int index) {
return (index & HARDENED_BIT) != 0;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy