I am new to storing passwords on databases and from what I read I have created a simple php script below

```
<?php
  $salt =  openssl_random_pseudo_bytes (16);
  $password = "test";
  $hash = hash ("sha512" , $salt . $password);

  echo $hash;
?>

```

1. Am I doing this correctly?
2. Should the salt be stored in databases as byte datatype?
3. Should the final hash be stored at String datatype in database?