Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when executing argon2 code in Buildship #1537

Open
adrfinance opened this issue Feb 2, 2024 · 0 comments
Open

Error when executing argon2 code in Buildship #1537

adrfinance opened this issue Feb 2, 2024 · 0 comments

Comments

@adrfinance
Copy link

Describe the bug
A code which uses argon2 fails to execute correctly

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Buildship'
  2. Click on 'New node'
  3. Use the following code:
import argon2 from 'argon2'

async function hashPassword(password) {
  try {
    // Hash password
    const hash = await argon2.hash(password);

    // Store the hash in your database or wherever you manage passwords
    console.log('Hash:', hash);
  } catch (err) {
    console.error('Error hashing password:', err);
  }
}

async function verifyPassword(hash, password) {
  try {
    // Verify password
    const isValid = await argon2.verify(hash, password);
    
    if (isValid) {
      console.log('Password is valid');
    } else {
      console.log('Password is invalid');
    }
  } catch (err) {
    console.error('Error verifying password:', err);
  }
}

// Example usage
const passwordToHash = 'securePassword123';
hashPassword(passwordToHash);

// In a real-world scenario, you would store the hash and then later verify the password
// For demonstration purposes, we'll immediately verify the password after hashing
verifyPassword('$argon2id$v=19$m=65536,t=2,p=1$9S6axxfv...exampleHash', passwordToHash);
  1. See error

Expected behavior
Expected was for the code to return the hashed password

Screenshots
If applicable, add screenshots to help explain your problem.

Rowy Run version
If applicable, share the Rowy Run version from your project settings.

Desktop (please complete the following information):
Windows, Chrome latest version

Smartphone (please complete the following information):
Through web

Additional context
None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant