code: func NewUserState(filename string, randomseed bool) (*UserState, error) {
  	var err error
  
  	db, err := simplebolt.New(filename)
  	if err != nil {
  		return nil, err
  	}
  
  	state := new(UserState)
  
  	state.users, err = simplebolt.NewHashMap(db, "users")
  	if err != nil {
  		return nil, err
  	}
  	state.usernames, err = simplebolt.NewSet(db, "usernames")
  	if err != nil {
  		return nil, err
  	}
  	state.unconfirmed, err = simplebolt.NewSet(db, "unconfirmed")
  	if err != nil {
  		return nil, err
  	}
  
  	state.db = db
  
  	// For the secure cookies
  	// This must happen before the random seeding, or
  	// else people will have to log in again after every server restart
  	state.cookieSecret = cookie.RandomCookieFriendlyString(30)
  
  	// Seed the random number generator
  	if randomseed {
  		rand.Seed(time.Now().UnixNano())
  	}
  
  	// Cookies lasts for 24 hours by default. Specified in seconds.
  	state.cookieTime = 3600 * 24
  
  	// Default password hashing algorithm is "bcrypt+", which is the same as
  	// "bcrypt", but with backwards compatibility for checking sha256 hashes.
  	state.passwordAlgorithm = "bcrypt+" // "bcrypt+", "bcrypt" or "sha256"
  
  	return state, nil
  }
docs: // NewUserState creates a new UserState struct that can be used for managing users.
  // connectionString may be on the form "username:password@host:port/database".
  // If randomseed is true, the random number generator will be seeded after generating the cookie secret
  // (true is a good default value).