Search:

Type: Posts; User: Djinn

Search: Search took 0.10 seconds.

  1. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Yes, but I guess I was curious what changes I could make to reference this as "long" expressions instead of int. Int is only 32 bit and could only do the first 2147483647 (16^8-1) without error. My...
  2. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Finally got it with a little bit of help from other sources.

    import java.security.MessageDigest;
    public class SHAHashingExample
    {
    public static void main(String[] args)throws Exception
    {...
  3. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    import java.security.MessageDigest;

    public class SHAHashingExample {
    public static void main(String[] args)throws Exception {
    String a = "0000000000000000"; // defines Original value
    ...
  4. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    I moved it like you said, but it still must be recognizing it as a method in a method. will use // to describe what I am trying to do.


    import java.security.MessageDigest;

    public class...
  5. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    I'll give it a go. Taking a break for a few hours and will let you know what I get.
  6. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    I'll admit I feel I am still too new to it all and I can only guess your meaning. I assume you mean I need to close off my initial for statement with a "}", then I can take the result and run it...
  7. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Always. ;)

    Is my prependzero string idea (from this post) a valid one to get the result I want with the leading zeros for the Original output? And if so, since Norm says I can't use "b" as a...
  8. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    The 3 lines I posted earlier was an example coding to get the leading zeros to stay with original 16 digit hex number. I was going to to use an if/else but instead saw this as an example and though...
  9. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    This is the error I get when I try to compile the above.


    SHAHashingExample.java:11: error: ';' expected
    String prependZeros(b); { // number >= 0
    ^...
  10. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Working with an if/else string for that.

    Edit:

    nevermind, I see what you mean.
    Using this but may need to rework it:

    String prependZeros(int number) { // number >= 0
    String s=...
  11. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    ok so far I got the hex values without the leading zeros by doing this:


    for (int b=Integer.parseInt(a);b<=17;b++) {
    String strHexNumber = Integer.toHexString(b);...
  12. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Per first post:
    Original: 0000000000000000
    Hash: fcdb4b423f4e5283afa249d762ef6aef150e91fccd810d43e5 e719d14512dec7
    <blank line>
    Original: 0000000000000001
    Hash:...
  13. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Ok, so this:


    import java.security.MessageDigest;

    public class SHAHashingExample
    {
    public static void main(String[] args)throws Exception
    {
    String a = "0000000000000000";
  14. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Nothing. That one is written to only give 1 output result. Per my original post, I want the consecutive output of 17 (0x0000000000000000 through 0x0000000000000010).


    In looking it over, I...
  15. Re: Setting up a loop for a SHA-256 hash for multiple outputs

    Here is the original one I was working with

    import java.security.MessageDigest;

    public class SHAHashingExample
    {
    public static void main(String[] args)throws Exception
    {
    ...
  16. Setting up a loop for a SHA-256 hash for multiple outputs

    I started only a few days ago trying to figure this out under "questions". Go there for an explanation of what I am trying to do.

    I've been reading a lot and I learned a little bit more about...
Results 1 to 16 of 16