[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/native-library](https://jsprismarine.dev/api/@jsprismarine/native-library/index.md) / nativeHash

# nativeHash

## Functions

### hasNativeSources()

> **hasNativeSources**(`packageDir`): `boolean`

Defined in: [nativeHash.ts:32](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/nativeHash.ts#L32)

Whether a package directory holds the native sources, which a checkout does and a published
package does not.

#### Parameters

##### packageDir

`string`

The package's directory.

#### Returns

`boolean`

True in a checkout.

***

### nativeSourceHash()

> **nativeSourceHash**(`packageDir`, `buildScripts`, `naming`): `string`

Defined in: [nativeHash.ts:46](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/nativeHash.ts#L46)

The hash that names a build of a native library. A release of builds is tagged with it, and the
manifest records the hash its builds were made from, so a checkout can tell whether its native
sources still match the published builds. Every change it sees publishes a new set of builds,
so it covers what can change a build and nothing else: the build's input files, and what the
shared naming helpers answer rather than their source.

#### Parameters

##### packageDir

`string`

The package's directory, holding `native/`.

##### buildScripts

readonly `string`[]

The files outside `native/` the build reads, relative to the package,
  such as its build script.

##### naming

`string`

What the shared naming helpers answer, from `namingAnswers` in `./platform`.

#### Returns

`string`

The first 16 hex digits of the SHA-256 over the build's inputs.
