Sorry, I'm dense:
How do I pass salt to compare()?
How can compare work w/o salt?
You do not need to pass a salt to compare because the salt is part of the hash that you are comparing the value against. To make it compatible across implementation bcrypt uses the modular crypt format to store data, which contains the salt embedded in it. See the glibc notes here for a description of the format http://man7.org/linux/man-pages/man3/crypt.3.html
Bcrypt is not supported by glibC, but the rest everything is applicable. bcrypt uses $2a$ as its identifier.
Most helpful comment
You do not need to pass a salt to compare because the salt is part of the hash that you are comparing the value against. To make it compatible across implementation
bcryptuses the modular crypt format to store data, which contains the salt embedded in it. See the glibc notes here for a description of the format http://man7.org/linux/man-pages/man3/crypt.3.htmlBcrypt is not supported by glibC, but the rest everything is applicable.
bcryptuses $2a$ as its identifier.