You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: files_sharings.go
    path of file: ./repos/quickshare/src/db/rdb/base
    
    the code of the file until where you have to start completion: package base

import (
	"context"
	"crypto/sha1"
	"database/sql"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"path"
	"time"

	"github.com/ihexxa/quickshare/src/db"
)

func (st *BaseStore) generateShareID(payload string) (string, error) {
	if len(payload) == 0 {
		return "", db.ErrEmpty
	}

	msg := fmt.Sprintf("%s-%d", payload, time.Now().Unix())
	h := sha1.New()
	_, err := io.WriteString(h, msg)
	if err != nil {
		return "", err
	}

	return fmt.Sprintf(
    
func (st *BaseStore) GetSharingDir(ctx context.Context, hashID string) (string, error) {
	tx, err := st.db.BeginTx(ctx, txOpts)
	if err != nil {
		return "", err
	}
	defer tx.Rollback()

	var sharedPath string
	err = tx.QueryRowContext(
		ctx,
		`select path
		from t_file_info
		where share_id=?
		`,
		hashID,
	).Scan(
		&sharedPath,
	)
	if err != nil {
		if errors.Is(err, sql.ErrNoRows) {
			return "", db.ErrSharingNotFound
		}
		return "", err
	}

	err = tx.Commit()
	if err != nil {
		return "", err
	}
	return sharedPath, nil
}